import java.util.Objects;

/**
 * @Author xiyuan
 * @Date 2021/12/24 13:08
 * @Version 1.0
 */
public class Account {
    private Integer money;
    private String username;

    public Account(Integer money, String username) {
        this.money = money;
        this.username = username;
    }

    //    默认新建的账户的金额为0
    public Account(String username) {
        this.username = username;
        this.money = 0;
    }

    public Account() {
    }

    @Override
    public String toString() {
        return
                "money=" + money +
                ", username=" + username ;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void addMoney(Integer money) {
        this.money += money;
    }

}
